#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

const int N = 3e5 + 10;

int n;
int q[N];


int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    int T;
    scanf("%d", &T);
    while(T--){
        scanf("%d", &n);
        for(int i = 1; i <= n; i ++) scanf("%d", &q[i]);

        if(n % 2 == 0){
            printf("YES\n");
        }else{
            bool find = false;
            for(int i = 1; i < n; i ++){
                if(q[i] >= q[i + 1]){
                    find = true;
                    break;
                }
            }

            if(find){
                printf("YES\n");
            }else{
                printf("NO\n");
            }
        }
    }

    return 0;
}